<layout name="page" />
<block name="content">
	<div class="main layui-clear">
		<h2 class="page-title">发表问题</h2>
		<!-- <div class="fly-none">并无权限</div> -->
		<div class="layui-form layui-form-pane">
			<form method="post" id="form-data">
				<input type="hidden" name="opmode" value="add">
				<div class="box">
					<label for="L_title" class="input-label">标题</label>
					
						<input type="text" id="L_title" name="name" check="required" class="input">
					</div>
				</div>
				<div class="layui-form-item layui-form-text">
					
						<textarea id="L_content" name="content" required  placeholder="请输入内容" class="textarea fly-editor" style="height: 260px;"></textarea>
					</div>
					<label for="L_content" class="input-label" style="top: -2px;">描述</label>
				</div>
				<div class="box">
					<div class="layui-inline">
						<label class="input-label">所在类别</label>
						
							<select  name="class">
								<option></option>
								<option value="1" >SEF框架</option>
								<option value="2" >系统使用</option>
								<option value="3" >二次开发</option>
							</select>
						</div>
					</div>
					<div class="layui-inline">
						<label class="input-label">悬赏</label>
						
							<select name="experience">
								<option value="5" selected>5</option>
								<option value="20">20</option>
								<option value="50">50</option>
								<option value="100">100</option>
							</select>
						</div>
					</div>
				</div>
				<div class="box">
					<label for="L_vercode" class="input-label">人类验证</label>
					<div class="input-inline">
						<input type="text" id="L_vercode" name="vercode" required  placeholder="请回答后面的问题" autocomplete="off" class="input">
					</div>
					<div class="layui-form-mid">
						<span style="color: #c00;">1+1=?</span>
					</div>
				</div>
				<div class="box">
					<a class="layui-btn" onclick="save();"> 立即发布 </a>
				</div>
			</form>
		</div>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		layui.cache.page = 'jie';
		layui.cache.user = {
			username : '游客',
			uid : -1,
			avatar : '../../res/images/avatar/00.jpg',
			experience : 83,
			sex : '男'
		};
		layui.use('fly', function() {

		});
		function save() {
			send_form("form-data", "{:url('save')}", "{:url('index/index')}", function(ret) {
				if (ret.status) {
					layer.msg(ret.info, {
						time : 1500
					}, function() {
						location.href = "{:url('index/index')}";
					});
				} else {
					layer.msg(ret.info);
					return false;
				}
			});
		}

	</script>
</block>